﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using CarsModel;
using CarsBll;

namespace SencondHandCarBuyAndSell1._0.Controllers
{
    public class IndentsController : ApiController
    {

        IndentsBll bll = new IndentsBll();
        /// <summary>
        /// 卖家购买商品
        /// </summary>
        /// <param name="indents">要购买的商品信息</param>
        /// <returns></returns>
        public string IndentADD([FromBody]Indents indents)
        {
            int i = bll.IndentADD(indents);
            if (i > 0)
            {
                return "添加成功";
            }
            else
            {
                return "添加失败，请联系管理员";
            }
        }

        /// <summary>
        /// 商品成交
        /// </summary>
        /// <param name="Indentid"></param>
        /// <param name="UsersID"></param>
        /// <returns></returns>
        public string IndentDelete(int Indentid, int UsersID)
        {
            int i = bll.IndentDelete(Indentid, UsersID);
            if (i > 0)
            {
                return "成交,期待我们下一次合作";
            }
            else
            {
                return "失败，请速与管理员联系";
            }
        }


    }
}
